#ifndef xpack_meta_has_constructor
#define xpack_meta_has_constructor
#pragma push_macro("xuser")
#undef  xuser
#define xuser mixc::meta_has_constructor::inc
#include"define/base_type.hpp"
#include"macro/xexport.hpp"
#include"macro/xforward.hpp"
#include"macro/xnew.hpp"
#pragma pop_macro("xuser")

namespace mixc::meta_has_constructor{
    template<class object_t>
    inline void test(object_t){}

    template<class object_t, class ... args_t>
    concept can_new = requires(object_t * this_ptr, args_t && ... args){
        xnew(this_ptr) object_t(xforward(args)...);
    };

    template<class object_t, class implict_t>
    concept can_implict_cast = requires(implict_t object){
        // 是否支持隐式构造
        test<object_t>(object);
    };

    template<class object_t, class implict_t>
    struct meta{
        static inline constexpr bool result = can_implict_cast<object_t, implict_t>;
    };

    template<class object_t, class ... args_t>
    struct meta<object_t, void(args_t...)>{
        static inline constexpr bool result = can_new<object_t, args_t...>;
    };

}

namespace mixc::meta_has_constructor::origin{
    template<class object_t, class constructor_t>
    concept has_constructor = meta<object_t, constructor_t>::result;
}

#endif

xexport_space(mixc::meta_has_constructor::origin)